package com.zb.common.po.enums;

import com.fasterxml.jackson.annotation.JsonFormat;

@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum RoleStatus {
    DELETE(-1, "删除"), NORMAL(0, "正常");

    private int type;
    private String description;

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    private RoleStatus(int type, String description) {
        this.type = type;
        this.description = description;
    }

    public static RoleStatus getStatusByType(Integer type) {
        for (RoleStatus at : RoleStatus.values()) {
            if (at.type == type) {
                return at;
            }
        }
        return null;
    }
}
